/**
 * 
 */
package com.lmm.car;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpResponseException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.lmm.http.client.HttpClientUtils2;
import com.lmm.rsa.RSAScriptEngine;

/**
 * 登录易拜通
 * @author leiming
 *
 */
public class LoginEasyPass {
	
	public static final String userName = "100043122";
	public static final String password = "ztrb1818";
	public  static final String appid = "00000000-0000-0000-0000-000000000000";
	public static final String urls = "";
	
	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		/*boolean islogin  = login();
		if(islogin){
			System.out.println("登录成功。");
		}else {
			System.out.println("登录失败。");
		}*/
		/*String imgBase64  = getDealerValidateCode();
		System.out.println(imgBase64);*/
		login();

	}
	
	

	public static void login() throws Exception{
			//System.out.println(getLoginContent());
			CloseableHttpClient httpclient = HttpClientUtils2.getHttpClient();
			StringBuffer sb = new StringBuffer("http://dealer.easypass.cn/Interface/CheckUserNameInterface.aspx?");
			sb.append("UserName=").append(userName);
			sb.append("&Pwd=").append(password);
			sb.append("&CheckCode=");
			sb.append("&autoLogin=true");
			sb.append("&appid=").append(appid);
			sb.append("&urls=");
        	HttpGet httpget = new HttpGet(sb.toString());
            httpget.setHeader("User-Agent", HttpClientUtils2.userAgent);
            String content  = httpclient.execute(httpget,HttpClientUtils2.basicResponseHandler);
            System.out.println(content);     
	}

	
}
